//#include "mainwindow.h"

#include <QApplication>
//#include <QMidArea>
#include <QMdiArea>
//#include <QMidSubWindow>
#include <QMdiSubWindow>
#include<QMainWindow>
#include <QTextEdit>
#include<QDockWidget>
#include <QPushButton>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
//    MainWindow w;
//    w.show();
    QMdiArea area;
    QMdiSubWindow subwin;//创建子窗口对象
    subwin.setWidget(new QTextEdit());
    area.addSubWindow(&subwin);//把子窗口添加到子窗口区域
    area.addSubWindow(new QTextEdit());
    area.addSubWindow(new QMainWindow());
//    area.show();

    QMainWindow*mainwin=new QMainWindow();
    QDockWidget*qdockwidget=new QDockWidget();//创建QDockWidget
    qdockwidget->setWidget(new QPushButton());
    mainwin->addDockWidget(Qt::TopDockWidgetArea,qdockwidget);
    mainwin->show();
    return a.exec();
}
